<head>
	<script>
	function member_save(){
		var f = document.registForm;
		
		if(f.m_id.value == ""){
			alert("아이디를 입력하세요");
			return false;
		}
		
		if(f.m_name.value == ""){
			alert("이름을 입력하세요");
			return false;
		}
		
		if(f.m_pass.value == ""){
			alert("비밀번호를 입력하세요");
			return false;
		}
		
		if(f.m_pass.value != f.m_pass2.value){
			alert("비밀번호를 확인하세요");
			return false;
		}
		
		f.submit();
	}
	</script>
</head>

<?php
    
    require("./include.php");
	
	if($_SESSION[user_id]){
		?>
		<script>
			alert("로그인 하신 상태입니다.");
			history.back();
		</script>
		<?
		
	}
?>
<body>
	<br/>
	<table style="width:1000px;height:50px;border:5px #CCCCCC solid;">
    	<tr>
   			<td align="center" valign="middle" style="font-zise:15px;font-weight:bold;">회원가입</td>
    	</tr>
	</table>
	
	<br/>
	<form name="registForm" method="post" action="./board_register_save.php" style="margin:0px;">
			
		<table style="width:1000px;height:50px;border:0px;">
			<tr>
				<td align="center" valign="middle" style="width:200px;height:50px;background-color:#CCCCCC;">
       				아이디
       			</td>
       			<td align="left" valign="middle" style="width:800px;height:50px;"><input type="text" name="m_id" style="width:380px;">
       			
        		</td>
    		</tr>
    		<tr>
        		<td align="center" valign="middle" style="width:200px;height:50px;background-color:#CCCCCC;">
        			이름
        		</td>
        		<td align="left" valign="middle" style="width:800px;height:50px;"><input type="text" name="m_name" style="width:380px;">
        			
        		</td>
    		</tr>
    		<tr>
        		<td align="center" valign="middle" style="width:200px;height:50px;background-color:#CCCCCC;">
        			비밀번호
        		</td>
        		<td align="left" valign="middle" style="width:800px;height:50px;"><input type="password" name="m_pass" style="width:380px;">
        			
        		</td>
    		</tr>
    		<tr>
        		<td align="center" valign="middle" style="width:200px;height:50px;background-color:#CCCCCC;">
        			비밀번호 확인
        		</td>
        		<td align="left" valign="middle" style="width:800px;height:50px;"><input type="password" name="m_pass2" style="width:380px;">
        			
        		</td>
    		</tr>
    		<tr>
    			<td align="center" valign="middle" colspan="2"><input type="button" value=" 회원가입 " onClick="member_save();">
    				
    			</td>
    		</tr>
		</table>
	</form>
</body>